package v1ch7.NotHelloWorld;

import java.awt.EventQueue;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class NotHelloWorld {
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {

			public void run() {
				NotHelloWorldFrame frame = new NotHelloWorldFrame();
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				frame.setVisible(true);
			}
		});
	}
}

@SuppressWarnings("serial")
class NotHelloWorldFrame extends JFrame {

	public NotHelloWorldFrame() {
		setTitle("NotHelloWorld");
		setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
		NotHelloWorldPanel panel = new NotHelloWorldPanel();
		add(panel);
	}

	private static final int DEFAULT_WIDTH = 300;
	private static final int DEFAULT_HEIGHT = 200;
}

@SuppressWarnings("serial")
class NotHelloWorldPanel extends JPanel {

	public void paintComponent(Graphics g) {
		g.drawString("Not a Hello,World program", MESSAGE_X, MESSAGE_Y);
	}

	private static final int MESSAGE_X = 75;
	private static final int MESSAGE_Y = 100;
}